package com.lengxf.design;

/**
 * 适配器角色
 * By Lengxf
 */
public class PoliceCarAdapter extends CarController {
    private final PoliceSound policeSound;

    private final PoliceLamp policeLamp;

    public PoliceCarAdapter() {
        this.policeSound = new PoliceSound();
        this.policeLamp = new PoliceLamp();
    }

    @Override
    public void voice() {
        policeSound.alarmSound();
    }

    @Override
    public void twinkle() {
        policeLamp.alarmLamp();
    }

}
